package metier;

import static org.junit.Assert.assertTrue;

import java.io.File;

import org.junit.Test;

import enumeration.type.ETypeFichier;

public class TransfereTest 
{
	@Test
	public void testJusteFichier() //ok
	{
		Transfere copie = new Transfere();
		File f = new File("configuration/test/copie/" + "android.pdf");
		boolean copy = copie.EnregisterFile(f, null, null);
		
		assertTrue(copy == true);
	}

	@Test
	public void testSansType() //ok
	{
		Transfere copie = new Transfere();
		File f = new File("configuration/test/copie/" + "walpaper.jpg");
		boolean copy = copie.EnregisterFile(f, "/home/mathieu/", null);
		
		assertTrue(copy == true);
	}
	
	@Test
	public void testTotal()	//ok
	{
		Transfere copie = new Transfere();
		File f = new File("configuration/test/copie/" + "this.mp3");
		boolean copy = copie.EnregisterFile(f, "/home/mathieu/", null);
		
		assertTrue(copy == true);
	}
	
	@Test
	public void testType()	//ok
	{
		Transfere copie = new Transfere();
		File f = new File("configuration/test/copie/" + "this.mp3");
		boolean copy = copie.EnregisterFile(f, null, ETypeFichier.MUSIQUE);
		
		assertTrue(copy == true);
	}
	
	@Test
	public void TestAvecErreur()	//ok
	{
		Transfere copie = new Transfere();
		File f = new File("configuration/test/copie/" + "thiss.mp3");
		boolean copy = copie.EnregisterFile(f, "/home/LABO/", ETypeFichier.MUSIQUE);
		
		assertTrue(copy == false);
	}
}
